{assign name="file" value="$info.file_id ?? ''|get_file='name'" /}
<div class="section">
    <div id="doc_file"></div>
    <input type="hidden" id='file_id' name="file_id" value="{$info.file_id ?? ''}"/>
    {notempty name="info.file_id"}
        <div class="upload-pre-item"><span class="fileCss">{$file ?? ''}<a href='javascript:void(0);' class='m-l-sm del_file'>X</a></span></div>
    {/notempty}
</div>
<script type="text/javascript">
    $(function () {
        var itemTemp = '<li><div id="${fileID}" class="uploadify-queue-item"><div class="file_height" id="${file}"></div> <div class="uploadify-progress"><div class="uploadify-progress-bar"></div></div><a href="javascript:void(0);" class="uploadbtn">上传</a><a href="javascript:void(0);" class="delfilebtn">删除</a><font id="message" class="${meg}"></font></div></li>';
        var file_name = "file_id";
        var up = $('#doc_file').Huploadify({fileTypeExts: '*.php;*.zip;*.7z;*.chm;*.tar.gz;*.rar;*.xls;*.doc;*.ppt;*.xlsx;*.docx;*.pptx;', buttonText: '选择文件', fileType: 2, buttonTemp: '', uploadOne: true, itemTemplate: itemTemp, auto: false, nputValue: file_name, multi: false, fileSizeLimit: 10240, showUploadedPercent: true, showUploadedSize: true, uploader: "{:\\think\\Url::build('Article/articleFile')}",
            onUploadSuccess: function (file,data) {
                var data = $.parseJSON(data);
                $(".message_" + file.index + "").text(data.msg);
            }, onUploadError: function (file,data) {
                var data = $.parseJSON(data);
                $(".message_" + file.index + "").text(data.msg);
            }, onUploadComplete: function (file, data) {
                var data = $.parseJSON(data);
                $("#file_id").val(data.data);
            }});
        $('.del_file').click(function () {
            $('.upload-pre-item').remove();
            $("input[name=" + file_name + "]").val('');
        });
    });
</script>
